import { getMedicalOrderDetail } from "@/apis/order"
import type { MedicalOrderDetail } from "@/types/order"
import { ref } from "vue"

export const useMedicineOrderDetail = (id: string) => {
  //订单详情
  const orderDetail = ref<MedicalOrderDetail>()

  // 查询订单详情
  async function getOrderDetail() {
    // 订单详情接口
    const data = await getMedicalOrderDetail(id)
    // 渲染订单数据
    orderDetail.value = data
  }

  // 查询订单详情
  getOrderDetail()

  return { orderDetail }
}
